load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "span",
    srcs = [
        "span_builder.go",
        "span_splitter.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/sql/span",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/keys",
        "//pkg/roachpb",
        "//pkg/sql/catalog",
        "//pkg/sql/catalog/catalogkeys",
        "//pkg/sql/catalog/catenumpb",
        "//pkg/sql/catalog/descpb",
        "//pkg/sql/catalog/fetchpb",
        "//pkg/sql/inverted",
        "//pkg/sql/opt/constraint",
        "//pkg/sql/rowenc",
        "//pkg/sql/rowenc/keyside",
        "//pkg/sql/sem/eval",
        "//pkg/sql/sem/tree",
        "//pkg/sql/types",
        "//pkg/util/encoding",
        "//pkg/util/intsets",
        "@com_github_cockroachdb_errors//:errors",
    ],
)

go_test(
    name = "span_test",
    size = "small",
    srcs = [
        "main_test.go",
        "span_splitter_test.go",
    ],
    deps = [
        ":span",
        "//pkg/base",
        "//pkg/security/securityassets",
        "//pkg/security/securitytest",
        "//pkg/server",
        "//pkg/sql/catalog",
        "//pkg/sql/catalog/descpb",
        "//pkg/sql/catalog/desctestutils",
        "//pkg/sql/catalog/systemschema",
        "//pkg/testutils/serverutils",
        "//pkg/util/intsets",
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "//pkg/util/randutil",
        "@com_github_stretchr_testify//require",
    ],
)
